
public class Video {

	private String id;
	private String title;
	private int length;

	public Video(String id, String title, int length) {
		this.id = id;
		this.title = title;
		this.length = length;
	}

	public void setID(String value) {
		if (value == null || value.length() == 0) {
			throw new IllegalArgumentException();
		}
		id = value;
	}

	public String getID() {
		return id;
	}

	public void setTitle(String value) {
		if (value == null || value.length() == 0) {
			throw new IllegalArgumentException();
		}
		title = value;
	}

	public String getTitle() {
		return title;
	}

	public void setLength(int value) {
		if (value < 0) {
			throw new IllegalArgumentException();
		}
		length = value;
	}

	public String toString() {
		return "Video(" + id + ", " + title + ", " + length + " minutes)";
	}

	public boolean equals(Object o) {
		if (o != null && o instanceof Video) {
			Video other = (Video)o;
			return other.id.equals(id);
		}
		else {
			return false;
		}
	}

}

